$(function(){
    var guanwang={
        data:{
            Eng_month:["January" ,"February", "March", "April" ,"May" ,"June","July","August","September","October","November","December"]
        },
        event:function () {

        },
        init:function () {
            var that=this;
            var id=location.href.match(/newsId=(\d+)/)&&location.href.match(/newsId=(\d+)/)[1];
            if(id){
               JsonP({
                    url:guanwangID+"index.php?s=home/news/listNewsArticlesQueryInfo",
                    data:{
                        article_id:id
                    },
                    success:function (res) {
                        if(res.resStatus===1){
                            var o=res.data[0];
                            var body_string='  <p><a href="/">首页</a> > <a href="news.html">盛铭吉新闻</a> > '+res.data[0].title+'</p>' +
                                '                <div class="news_detial_wrap">' +
                                '                    <div>' +
                                '                         <p>'+new Date(o.time.split(" ")[0]).getDate()+'</p>' +
                                '                         <p>'+that.data.Eng_month[new Date(o.time.split(" ")[0]).getMonth()]+'</p>' +
                                '                         <p>'+new Date(o.time.split(" ")[0]).getFullYear()+'</p>' +
                                '                    </div>' +
                                '                    <div class="um_wrap">'+o.dataContent+'</div>' +
                                '                </div>';

                            $(".anli_detial_wrap").empty().append(body_string);
                            var text=$(".um_wrap").text();
                            $(".um_wrap").empty().append(text);

                            var p_left='<p></p>';
                            var p_right='<p></p>';
                            o.articlesNum.next && (p_left='<p><a href="news_detial.html?newsId='+o.articlesNum.next.article_id+'"><span>上一篇</span> <b>'+o.articlesNum.next.title+'</b></a></p>');
                            o.articlesNum.previous && (p_right='<p><a href="news_detial.html?newsId='+o.articlesNum.previous.article_id+'"><span>下一篇</span> <b>'+o.articlesNum.previous.title+'</b></a></p>');
                            $(".f_nav_wrap").empty().append(p_left+p_right);
                        }
                    }
                });
            }


        }
    };

    guanwang.init();
});